<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        setTimeout(() => console.log(0))
        Promise.resolve().then(() => {
            console.log(1);
            Promise.resolve().then(() => {
                console.log(2);
            })
        })
        console.log(3);
        /*
        expected output:
        3
        1
        2
        0
        证明：微任务中若还有微任务，则在该轮微任务队列中一起执行
        */
    </script>
</body>

</html>